class Employee:
    def __init__(self, name, number, salary):
        self.name = name
        self.number = number
        self.salary = salary

    def get_salary(self):
        """
        计算工资
        :return:
        """
        return self.salary

    def get_number(self):
        """
        获取工号
        :return:
        """
        return self.number


class Worker(Employee):

    def __init__(self, name, number, salary, work_time, hourly_wage):
        super(Worker, self).__init__(name, number, salary)
        self.work_time = work_time
        self.hourly_wage = hourly_wage

    def get_salary(self):
        return self.work_time * self.hourly_wage + self.salary

    def __str__(self):
        return "工人{},工号{},工时{},时薪{},基础工资{}".format(self.name, self.number, self.work_time, self.hourly_wage,
                                                   self.salary)


class SalesMan(Employee):
    def __init__(self, name, number, salary, sale_num, commission):
        super(SalesMan, self).__init__(name, number, salary)
        self.sale_num = sale_num
        self.commission = commission

    def get_salary(self):
        return self.sale_num * self.commission + self.salary

    def __str__(self):
        return "销售{},工号{},销售额{},提成{},基础工资{}".format(self.name, self.number, self.sale_num, self.commission, self.salary)


class Manager(Employee):
    def __init__(self, name, number, salary):
        super(Manager, self).__init__(name, number, salary)

    def get_salary(self):
        super().get_salary()
        return self.salary

    def __str__(self):
        return "经理{},工号{},基础工资{}".format(self.name, self.number, self.salary)


class SalesManager(SalesMan):
    def __init__(self, name, number, salary, sale_num, commission):
        super(SalesManager, self).__init__(name, number, salary, sale_num, commission)

    def __str__(self):
        return "销售经理{},工号{},销售额{},提成{},基础工资{}".format(self.name, self.number, self.sale_num, self.commission,
                                                      self.salary)


w = Worker("张三", "N001", 0, 8, 10)
print(w)
print("工人工资{}".format(w.get_salary()))
print()

s = SalesMan("李四", "N002", 0, 1000, 0.5)
print(s)
print("销售工资{}".format(s.get_salary()))
print()

m = Manager("王五", "N003", 100)
print(m)
print("经理工资{}".format(m.get_salary()))
print()

sm = SalesManager("赵六", "N001", 100, 1000, 0.6)
print(sm)
print("销售经理工资{}".format(sm.get_salary()))
